using System;
using System.Collections.Generic;
using System.Text;

namespace DynamicData.Entities
{
    public class BooksToAuthors
    {
        public int IdAuthor { get; set; }

        public int IdBook { get; set; }

        public override int GetHashCode()
        {
            return IdAuthor.GetHashCode() * 12 + IdBook.GetHashCode();
        }

        public override bool Equals(object obj)
        {
            if (obj == null)
                return false;

            var booksToAuthors = obj as BooksToAuthors;
            if (booksToAuthors == null)
                return false;

            return booksToAuthors.IdAuthor == this.IdAuthor && booksToAuthors.IdBook == this.IdBook;
        }

    }
}
